package com.itheima.接口.接口的新特性_03.jdk8静态方法;

//静态方法
public interface Swim {
    void swimming();


    public default void code(){
        System.out.println("接口的默认方法..");
    }

    //静态方法: 只属于当前接口,只能用当前接口去调用
    public static void method(){
        System.out.println("接口的静态方法..");
    }
}

//类实现接口必须重写接口中所有抽象方法
class Person implements Swim{

    @Override
    public void code() {
        System.out.println("我在黑马好好写代码");
    }

    @Override
    public void swimming() {
        System.out.println("人学会了仰泳");
    }
}

class Dog implements Swim{

    @Override
    public void swimming() {
        System.out.println("狗狗学会了狗刨");
    }
}
